<div class="form-group" {guanlians}>
	<label class="col-xs-12 col-sm-3 col-md-2 right-label">{{check_show_lang('{title}')}}</label>
	<div class="col-xs-12 col-sm-8 col-lg-9">
		<div class="input-group">
			<input type="text" ng-model="{tovalue}.{name}" class="form-control audio-player-media" autocomplete="off" readonly="readonly">
			<span class="input-group-btn">
				<button class="btn btn-primary audio-player-play" type="button" style="display:none;"><i class="fa fa-play"></i></button>
			</span>
		</div>
		<div class="input-group audio-player"></div>
	</div>
</div>
<script type="text/javascript">
	if(!window.upload_audio){
		window.upload_audio=true;
		function setAudioPlayer(){
			require(["jquery.jplayer"], function($){
				$(function(){
					$(".audio-player").each(function(){
						$(this).prev().find("button").eq(0).click(function(){
							var src = $(this).parent().prev().val();
							if($(this).find("i").hasClass("fa-stop")) {
								$(this).parent().parent().next().jPlayer("stop");
							} else {
								if(src) {
									$(this).parent().parent().next().jPlayer("setMedia", {mp3: window.scope.tomedia(src)}).jPlayer("play");
								}
							}
						});
					});

					$(".audio-player").jPlayer({
						playing: function() {
							$(this).prev().find("i").removeClass("fa-play").addClass("fa-stop");
						},
						pause: function (event) {
							$(this).prev().find("i").removeClass("fa-stop").addClass("fa-play");
						},
						swfPath: "../core/resource/components/jplayer",
						supplied: "mp3"
					});
					$(".audio-player-media").each(function(){
						$(this).next().find(".audio-player-play").css("display", $(this).val() == "" ? "none" : "");
					});
				});
			});
		}
		setAudioPlayer();
	}
	
</script>